Skip to content

feat(diagnostics): detect and report coreutils variant#2538

Open
andrianbalanesq wants to merge 1 commit into
bit-team:devfrom
andrianbalanesq:feat/diagnostics-coreutils
Open

feat(diagnostics): detect and report coreutils variant#2538
andrianbalanesq wants to merge 1 commit into
bit-team:devfrom
andrianbalanesq:feat/diagnostics-coreutils

Conversation

@andrianbalanesq

@andrianbalanesq andrianbalanesq commented Jul 13, 2026

Copy link
Copy Markdown

First-time Contributor Introduction

Hi! I'm Adrian, a developer interested in contributing to backup and system tools. This is my first PR to Back In Time — happy to follow the contribution guidelines and learn the project's conventions.


What

Add coreutils variant detection to the --diagnostics output. The diagnostics now probe ls --version and identify whether the system uses GNU coreutils, Rust/uutils, or BusyBox.

Why

Closes #2478.

Different coreutils implementations (GNU, Rust/uutils, BusyBox) have behavioral differences that can affect rsync-based backups, path handling, and flag support. Knowing which variant is installed helps with issue triage and debugging.

How

  • New function _get_coreutils_info() in common/diagnostics.py that:
    1. Runs ls --version via the existing _get_extern_versions() helper
    2. Parses the output to identify the variant:
      • GNU coreutils: output contains "GNU coreutils" (e.g. ls (GNU coreutils) 9.4)
      • BusyBox: output contains "BusyBox" (e.g. BusyBox v1.36.1 ...)
      • Rust/uutils: output contains "uutils" (prefixed with Rust/uutils coreutils - for clarity)
      • Unknown: returns the first line as-is
    3. Handles missing ls gracefully (returns (no ls))

Add coreutils detection to the --diagnostics output by probing
'ls --version' and identifying the variant (GNU coreutils, Rust/uutils,
or BusyBox). This helps with issue triage when users report bugs that
may be caused by coreutils implementation differences.

Closes bit-team#2478

@buhtz buhtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Adrian,

On behalf of the team, thank you for your contribution and taking the time to improve Back In Time. We appreciate it.

Your PR looks fine. I just have some minor suggestions.

It seems you are a "first-time contributor" to this project. So you might have missed this directive while opening the PR?

The PR will be closed if you haven't introduced yourself as a first time contributor.

Please also have a look at this contribution info: https://github.com/bit-team/backintime/blob/dev/CONTRIBUTING.md#before-you-start

To find out how we usually tread PRs please read "What happens after you opened a PullRequest (PR)?".

Best,
Christian

Comment on lines +151 to +157
@patch('diagnostics._get_extern_versions')
def test_coreutils_not_found(self, mock_extern):
"""Handle missing ls gracefully."""
mock_extern.return_value = '(no ls)'
# pylint: disable=protected-access
result = diagnostics._get_coreutils_info()
self.assertEqual(result, '(no ls)')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Adrian,

I see no value in testing for "not found" but feed the return value. Technically it tests the same as test_coreutils_uutils(). But I might miss something here?

What do you think?

@buhtz buhtz added PR: Modifications requested Maintenance team requested modifications and waiting for their implementation Feedback needs user response, may be closed after timeout without a response labels Jul 13, 2026
@AndrianBalanescu

Copy link
Copy Markdown

Hi Christian, thanks for the warm welcome and the review!

You make a fair point about test_coreutils_not_found — it's testing the same path as test_coreutils_uutils() since the return value feeds the same logic. I'll remove it to avoid redundancy.

I also missed the first-time contributor introduction in the PR description — apologies! Adding it now. Happy to follow the contribution guidelines going forward.

@buhtz buhtz added Prio: High and removed Feedback needs user response, may be closed after timeout without a response labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Modifications requested Maintenance team requested modifications and waiting for their implementation Prio: High

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diagnostics: gnu or rust coreutils

3 participants